package com.dnjn.happiness.survey.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dnjn.happiness.common.core.annotation.Excel;
import com.dnjn.happiness.common.core.web.domain.BaseEntity;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import lombok.experimental.Accessors;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.util.Date;
import java.util.List;

/**
 * 答案表对象 svy_answer
 *
 * @author happiness
 * @date 2023-10-24
 */
@Schema(name = "Answer", description = "答案表")
@Accessors(chain = true)
@Getter
@Setter
@TableName("svy_answer")
public class Answer extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * PK
     */
    @JsonSerialize(using = ToStringSerializer.class)
    @TableId(value = "answer_id", type = IdType.ASSIGN_ID)
    private Long answerId;

    


    /**
     * 答题人Id
     */
    @Schema(description = "答题人Id")
    @Excel(name = "答题人Id")
    private Long userId;

    /**
     * $column.columnComment
     */
    @Schema(description = "${comment}")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long surveyId;

    /**
     * $column.columnComment
     */
    @Schema(description = "${comment}")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long questionId;

    /**
     * 答案
     */
    @Schema(description = "答案")
    @Excel(name = "答案")
    private String answer;

    /**
     * Y-N
     */
    @Schema(description = "Y-N")
    @Excel(name = "Y-N")
    private String isRight;

    /**
     * $column.columnComment
     */
    @Schema(description = "${comment}")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Date dateStart;

    /**
     * $column.columnComment
     */
    @Schema(description = "${comment}")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Date dateEnd;

    /**
     * $column.columnComment
     */
    @Schema(description = "${comment}")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long siteId;

    /**
     * $column.columnComment
     */
    @Schema(description = "${comment}")
    @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
    private Long surveyRecordId;

//    /** 创建者|by_created|user_crt */
//    private String createBy;

    /**
     * 是否删除|0-否 1-是|valid
     */
    @Schema(description = "是否删除|0-否 1-是|valid")
    @Excel(name = "是否删除|0-否 1-是|valid")
    private String deleted;

    @TableField(exist = false)
    @Schema(description = "题号")
    private List<Long> questionIds;

    @TableField(exist = false)
    @Schema(description = "正确答案")
    private String answerRight;

    @TableField(exist = false)
    @Schema(description = "答题人姓名")
    private String username;

    /**
     * 是否多选 Y-N
     */
    @TableField(exist = false)
    @Schema(description = "是否多选 Y-N")
    @Excel(name = "是否多选 Y-N")
    private String isMultipleChoice;

    /**
     * 标题
     */
    @TableField(exist = false)
    @Schema(description = "标题")
    @Excel(name = "标题")
    private String title;

    /**
     * A
     */
    @Schema(description = "A")
    @Excel(name = "A")
    @TableField(exist = false)
    private String optionA;


    /**
     * B
     */
    @Schema(description = "B")
    @Excel(name = "B")
    @TableField(exist = false)
    private String optionB;

    /**
     * C
     */
    @Schema(description = "C")
    @Excel(name = "C")
    @TableField(exist = false)
    private String optionC;

    /**
     * D
     */
    @Schema(description = "D")
    @Excel(name = "D")
    @TableField(exist = false)
    private String optionD;

    /**
     * E
     */
    @Schema(description = "E")
    @Excel(name = "E")
    @TableField(exist = false)
    private String optionE;

    /**
     * F
     */
    @Schema(description = "F")
    @Excel(name = "F")
    @TableField(exist = false)
    private String optionF;

    @Schema(description = "选项A分值")
    @TableField(exist = false)
    private Integer scoreOptionA;

    @Schema(description = "选项B分值")
    @TableField(exist = false)
    private Integer scoreOptionB;

    @Schema(description = "选项C分值")
    @TableField(exist = false)
    private Integer scoreOptionC;

    @Schema(description = "选项D分值")
    @TableField(exist = false)
    private Integer scoreOptionD;

    @Schema(description = "选项E分值")
    @TableField(exist = false)
    private Integer scoreOptionE;

    @Schema(description = "选项F分值")
    @TableField(exist = false)
    private Integer scoreOptionF;

    @Schema(description = "选项G分值")
    @TableField(exist = false)
    private Integer scoreOptionG;

    /**
     * 接受前端答题选择题目分值，测试用
     */
    private String score;


    public String getqAnswer() {
        return qAnswer;
    }

    public void setqAnswer(String qAnswer) {
        this.qAnswer = qAnswer;
    }

    /**
     * G
     */
    @Schema(description = "G")
    @Excel(name = "G")
    @TableField(exist = false)
    private String optionG;

    @Schema(description = "题目答案")
    @Excel(name = "题目答案")
    @TableField(exist = false)
    private String qAnswer;

    @Schema(description = "答题总分值")
    @TableField(exist = false)
    private Integer surveyScore;

    @Schema(name = "答题结果类型 人格|性格答题结果")
    @TableField(exist = false)
    private String answerType;


    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("answerId", getAnswerId())
                .append("userId", getUserId())
                .append("surveyId", getSurveyId())
                .append("questionId", getQuestionId())
                .append("answer", getAnswer())
                .append("isRight", getIsRight())
                .append("dateStart", getDateStart())
                .append("dateEnd", getDateEnd())
                .append("siteId", getSiteId())
                .append("surveyRecordId", getSurveyRecordId())
                .append("remark", getRemark())

                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("deleted", getDeleted())
                .append("version", getVersion())
                .toString();
    }
}
